package com.winit.cloudlink.mgmt.recovery;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.io.File;
import java.io.Serializable;

@ConfigurationProperties(prefix = "spring.cloudlink.mgmt.recovery")
public class RecoveryProperties implements Serializable {

    private String backupDir = getDefaultBackupDir();

    public String getBackupDir() {
        return backupDir;
    }

    public void setBackupDir(String backupDir) {
        this.backupDir = backupDir;
    }

    private String getDefaultBackupDir() {
        StringBuffer dir = new StringBuffer();
        dir.append(System.getProperty("user.home"))
                .append(File.separator).append("cloudlink").append(File.separator).append("backup").append(File.separator);
        return dir.toString();
    }
}
